//
//  NetworkConfig.m
//  iAccountBook
//
//  Created by 侯伟 on 2020/1/2.
//  Copyright © 2020 侯伟. All rights reserved.
//

#import "NetworkConfig.h"
#import <UIKit/UIKit.h>
#import "HApp.h"
#import "HDevice.h"
#import "IdfaTool.h"
#import "RSSession.h"
#import "AppConfig.h"
@implementation NetworkConfig

+ (NSDictionary*)configRequestHeader:(NSString*)token{
    
    NSMutableDictionary* headers = [NSMutableDictionary dictionary];
    [headers setValue:[HApp identifier] forKey:@"identifier"];
    [headers setValue:[HApp buildNub] forKey:@"versionCode"];
    [headers setValue:[HApp version] forKey:@"versionName"];
    [headers setValue:[HDevice reachableViaType] forKey:@"netType"];
    [headers setValue:[IdfaTool getIDFA] forKey:@"idfa"];
    [headers setValue:[HDevice machineMode] forKey:@"model"];
    [headers setValue:[HDevice mac] forKey:@"macAddr"];
    [headers setValue:[UIDevice currentDevice].systemVersion forKey:@"systemVersion"];
    return headers;
}

+ (void)configNetwork{
    
    RequestOperation.URL = [NSString stringWithFormat:@"%@/%@",ApiUrl.URL,ApiUrl.PATH];
    
    [RequestOperation setRequestHeader:[NetworkConfig configRequestHeader:NULL]];
}

@end
